package classTest.HomeWork.day1;

import com.sun.xml.internal.bind.v2.runtime.output.StAXExStreamWriterOutput;

public class Test01 {
    public static void main(String[] args) {
        String  fileName1="shjdh.png";//要png
        String fileName2="djhfh.3.4.js";//要js
        String test =getExtByName(fileName1);
        System.out.println(test);
        test=getExtByName(fileName2);
        System.out.println(test);
    }
    public static String getExtByName(String name){
        int index=name.lastIndexOf(".")+1;
        String test=name.substring(index);
        return test ;
    }
}
